/*
 *  ifxconversion.hpp - conversion utilities
 *
 *    Copyright (c) 2001-2006, Luxena Software Company. All rights reserved.
 *
 *  Purpose:
 *
 */

#ifndef __IFXCONVERSION_HPP__
#define __IFXCONVERSION_HPP__

#ifndef __cplusplus
#error This header requires a C++ compiler ...
#endif

#include <ifxtypes.h>
#include <decimal.h>
#include <datetime.h>
#include <int8.h>
#include "dbxpress.hpp"


/////////////////////////////////////////////////////////////////////////////
// Data type conversion utilities

void bcd_to_decimal(FMTBcd *pbcd, decimal *pdec);
void decimal_to_bcd(decimal *pdec, FMTBcd *pbcd, int4 iColPrec, int4 iColScale);
DFLOAT decimal_to_double(decimal *pdec);
void int8_to_bcd(ifx_int8 *pint8, FMTBcd *pbcd);
DFLOAT int8_to_double(ifx_int8 *pint8);

void ctimestamp_to_dtime (pCTIMESTAMP ptstmp, dtime *pdtime);
void timestamp_to_dtime (DFLOAT stmp, dtime *pdtime);
void time_to_dtime (INT32 time, dtime *pdtime);
void dtime_to_ctimestamp (dtime *pdtime, pCTIMESTAMP ptstmp);
void interval_to_char(intrvl *pintrvl, char *pbuffer);

#endif // __IFXCONVERSION_HPP__
